<template>
  <view class="content">
    <dgg-swiper :list="bannerList"></dgg-swiper>
    <up-notice-bar :text="'uview-plus UI众多组件覆盖开发过程的各个需求，组件功能丰富，多端兼容。让您快速集成，开箱即用'"></up-notice-bar>
  </view>
</template>

<script setup lang="ts">
  import { getHomeBannerAPI } from '@/services/home'
  import type { BannerItem } from '@/types/home'
  import { onLoad } from '@dcloudio/uni-app'
  import { ref, type Ref } from 'vue'

  const bannerList = ref<BannerItem[]>([])

  const title: Ref<string> = ref('Hello')
  console.log(title.value)

  onLoad(() => {
    getHomeBannerData()
    // uni.navigateTo({ url: '/pages/login/login' })
  })

  const getHomeBannerData = async () => {
    const res = await getHomeBannerAPI(2)
    bannerList.value = res.data
  }
</script>

<style lang="scss"></style>
